﻿Imports MyPOSLibrary
Imports MyPOSDataLayer

Public Class CompanyInfoUserControl
    Implements IPOSData

    Public Property ConnectionString As String Implements MyPOSLibrary.IPOSData.ConnectionString

    Public Function DataValidation() As Boolean Implements MyPOSLibrary.IPOSData.DataValidation

    End Function

    Public Sub LoadData(ByVal ID As Integer) Implements MyPOSLibrary.IPOSData.LoadData
        Try
            Dim DataObject As New MasterDataLayer(ConnectionString)
            Dim CompanyObject As CompanyInfo = Nothing
            CompanyObject = DataObject.GetCompanyInfo
            If CompanyObject IsNot Nothing Then
                NameTextBox.Text = CompanyObject.Name
                AddressTextBox.Text = CompanyObject.Address
                DescriptionTextBox.Text = CompanyObject.Description
                TelNo1TextBox.Text = CompanyObject.TelNo
                VATNoTextBox.Text = CompanyObject.VATNo
                CSTNoTextBox.Text = CompanyObject.CSTNo
                InvoiceTermTextBox.Text = CompanyObject.InvoiceTerm
            End If
        Catch ex As Exception

        End Try
    End Sub

    Public Function SaveData() As Boolean Implements MyPOSLibrary.IPOSData.SaveData

    End Function

    Private Sub CompanyInfoUserControl_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
        LoadData(0)
    End Sub
End Class
